package com.indusfo.spc.mapper;

import com.indusfo.spc.pojo.Workshop;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: louk
 * @Description:车间信息mapper
 * @date: 2019/11/15 10:07
 *
 */

public interface WorkshopMapper {

    /**
     * 查询单个车间
     *
     * @author chenm
     * @date 2019/07/15 10:33
     * @param workshopId
     * @return java.util.List<com.indusfo.spc.pojo.ProductLine>
     */
    List<Workshop> getWorkshop(@Param("workshopId") Integer workshopId);

    /**
     * 查询多个车间
     *
     * @author xuz
     * @date 2018/11/30 2:16 PM
     * @param workshop
     * @return java.util.List<com.indusfo.spc.pojo.ProductLine>
     */
    List<Workshop> listWorkshop(Workshop workshop);


    /**
     * 查询分页总数
     *
     * @author xuz
     * @date 2018/12/3 3:17 PM
     * @param workshop
     * @return int
     */
    int countWorkshop(Workshop workshop);

    /**
     * 删除工位信息
     * @param workshopIds
     * @param dataState
     * @return
     */
    int delWorkshop(@Param("workshopIds") Integer[] workshopIds, @Param("dataState") Integer dataState);



    /**
     * 根据编码查询车间
     * @param workshopCode
     * @param workshopId
     * @return
     */
    Workshop queryByWorkshopCode(@Param("workshopCode") String workshopCode, @Param("workshopId") Integer workshopId);

    /**
     * 新增产线
     * @param workshop
     * @return
     */
    int insertSelective(Workshop workshop);

    /**
     * 更新产线
     * @param workshop
     * @return
     */
    int updateByPrimaryKeySelective(Workshop workshop);

    /**
     * 根据车间名称去重
     * @param workshop
     * @return
     */
    int selectByWorShopName(Workshop workshop);
}